<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head>
	<th:block data-th-replace="/adminlte/base::base-head"></th:block>
</head>

<body>
	<div class="wrapper">
		<th:block data-th-replace="/adminlte/base::base-navbar"></th:block>
		<th:block data-th-replace="/adminlte/base::base-main-sidebar"></th:block>
		<div class="content-wrapper">
			<iframe src="/admin/index" width="100%" height="100%" id="targetF"></iframe>
		</div>
		<th:block data-th-replace="/adminlte/base::base-footer"></th:block>
		<th:block data-th-replace="/adminlte/base::base-control-sidebar"></th:block>
	</div>
	<script type="text/javascript">
		function setIframeHeight(iframe) {
			if (iframe) {
				var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
				if (iframeWin.document.body) {
					iframe.height = iframe.parentNode.scrollHeight - 57;
				}
			}
		};
		window.onload = function () {
			setIframeHeight(document.getElementById('targetF'));
		};
		var allMenus = $("aside nav ul li > a[href!='#']");
		var current = $(allMenus[0]);
		current.addClass("active");
		
		allMenus.each((i,e) => {
			$(e).unbind("click").click((evt) => {
				current.removeClass("active");
				current = $(e);
				current.addClass("active");
				$("#targetF").attr("src", e.href);
				current.addClass("active");
				evt.preventDefault();
				return false;
			});
		});
	</script>
</body>

</html>